
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Tank
 */
public class Task2 <T> {

    /**
     * @param args the command line arguments
     */


    Scanner sc = new Scanner(System.in);
    ArrayList  ar;
    public void print()
    {
    System.out.println("if you want to enter an Integer ,press 1");
    System.out.println("if you want to enter an Boolean ,press 2");
    System.out.println("if you want to enter an Double ,press 3");
     System.out.println("if you want to end enter ,press 4");
    }
    public  Task2()
    {
      ar = new  ArrayList();
    }
      int i=0;
      int inttime=0;
      int booleantime=0;
      int doubletime=0;
    public void  En()
    {

    // boolean ok=true
    print();
    boolean ok= true;
    while(ok)
    {
        int enter = sc.nextInt();
     switch(enter)
    {
        case 1 :
             System.out.println(" enter an Integer ");
             int enterInt = sc.nextInt();
             ar.add(enterInt);
              inttime++;
              print();
             break;
        case  2 :
            System.out.println(" enter an boolean");
             boolean enterBoolean = sc.nextBoolean();
             ar.add(enterBoolean);
             booleantime++;
             print();
             break;
        case 3:
            System.out.println(" enter an double ");
            double enterdouble = sc.nextDouble();
            ar.add(enterdouble);
            doubletime++;
            print();
            break;
        case 4:
             ok=false;
             break;







     }
    }
    }

    public void insert()
    {
       int inte [] = new int [inttime];
       boolean bo [] = new boolean [booleantime];
       double dou [] = new double[doubletime];
        int indexint =0;
         int indexdouble=0;
         int indexboolean =0;
       for(int i=0;i<ar.size();i++)
       {
           if(ar.get(i) instanceof Integer)
           {


               inte[indexint]=(Integer)ar.get(i);
               indexint++;
           }else if(ar.get(i) instanceof Boolean)
           {

               bo[indexboolean]=(Boolean)ar.get(i);
               indexboolean++;

           }else if(ar.get(i) instanceof Double)
           {

               dou[indexdouble]=(Double)ar.get(i);
               indexdouble++;

           }

       }

      System.out.println("ssssssssssssss"+inte.length);
         System.out.println("ssssss"
                 + ""
                 + ""
                 + ""
                 + ""
                 + "ssssssss"+bo.length);
            System.out.println("ssssssssssssss"+dou.length);



    }





    public static void main(String[] args) {
        // TODO code application logic here



        Task2 t = new Task2();
        t.En();
        t.insert();




    }
}

